package com.mycompany.j2eem.Mapper.wrjmapper;

import com.mycompany.j2eem.Entity.bean.RecommendItem;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author wurj
 * @time 2019/4/16 13:57
 * @description
 */
public interface RecommendationMapper {
    //搜索Like_picture表单  Account_id ,picture_id
    @Select("select Account_id,Picture_id from Like_picture")
    List<RecommendItem> getAllMessage();

    //搜索路径
    @Select("select picturepath from Picture where id = #{Picture_id}")
    String getPath(@Param("Picture_id")String picId);

    //搜索标签名字
    @Select("select tagname from TagName where id=#{id}")
    String getTagName(@Param("id")String Picture_in_id);

    //搜索标签名ID
    //wucy改
    @Select("select TagName_id from Picture_Attritube where Picture_id = #{Picture_id}")
    String getTagNameIdByPicId(@Param("Picture_id")String id);

    //搜索用户名
    @Select("select username from Account where id=#{Account_id}")
    String getUserName(@Param("Account_id")String id);

    //搜索标签Id通过标签名字
    @Select("select id from TagName where tagname=#{tagname}")
    String getTagNameIdByTagName(@Param("tagname")String tagname);


    //
    @Select("select tagname from TagName where id=#{id}")
    String getTagNameByTagNameId(@Param("id")String id);
}
